import java.util.*;

public class ErrorRecovery {
  public static void main(String[] args){
     int num = 0;
     boolean validInputType;
     Scanner scanner = new Scanner(System.in);
        
     do{
         System.out.println("Enter an integer number  in the [10,100] interval: ");
         try{
            num = scanner.nextInt();
            validInputType = true; 
          }
          catch(InputMismatchException e){
              System.out.println("Error: " + e);
              validInputType = false;
              scanner.nextLine();      // remove new-line character from input buffer
          }
     	       
     	  if(validInputType){
     	     if(num < 10 || num >100)
               System.out.println("Sorry input outside the range [10, 100], try again");
     	  }
	               
	 }while (!validInputType || num < 10 || num > 100);
	   
	 System.out.println("Now your input is correct");
  }
}
